<%@page import="com.tjsinfo.tjsoa.common.DayFormat"%>
<%@ taglib uri="/WEB-INF/app.tld" prefix="app" %>
<app:validateSession/>
<%@ page language="java"
	import="java.util.*,com.tjsinfo.tjsoa.system.*,com.tjsinfo.tjsoa.efile.vo.Efile,com.tjsinfo.tjsoa.common.DealString"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()+ path + "/";
	String base = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()+ path;
    String cid=request.getParameter("cid");
    String type=request.getParameter("type");
	DealString ds=new DealString();
//	String rid=(String)session.getAttribute("rid");
    List<Efile> list = (List) request.getAttribute("list");
    String level1=(String)request.getAttribute("level1");
    String level2=(String)request.getAttribute("level2");
    String level3=(String)request.getAttribute("level3");
    String level4=(String)request.getAttribute("level4");
    String level5=(String)request.getAttribute("level5");
    String lev1="";
    String lev2="";
    String lev3="";
    String lev4="";
    String lev5="";
    if(level1 != null){lev1=level1;}
    if(level2 != null){lev2=level2;}
    if(level3 != null){lev3=level3;}
    if(level4 != null){lev4=level4;}
    if(level5 != null){lev5=level5;}
	if(cid==null)cid=(String)request.getAttribute("cid");
	boolean isDel=false;
	Efile efile=null;
	String menuName="信息管理";
	if(cid.equals("1")){menuName="集团考勤";if(level1.equals("true"))isDel=true;}
	if(cid.equals("2")){menuName="党群管理类";if(level2.equals("true"))isDel=true;}
	if(cid.equals("3")){menuName="行政管理类";if(level3.equals("true"))isDel=true;}
	if(cid.equals("4")){menuName="经营管理类";if(level4.equals("true"))isDel=true;}
	if(cid.equals("5")){menuName="生产管理类";if(level5.equals("true"))isDel=true;}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>天津市粮油集团有限公司 OA办公自动化协作平台</title>
<link href="<%=basePath %>efile/style/css.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='<%=basePath%>efile/js/time.js'></script>

<script type="text/javascript">
		<!--
		function submitInfoPages(value,str){
			if(value==0){
				alert("请重新选择页码!");
				return ;
			}
			window.location.href='<%=basePath %>tjsinfo/tjsoa/efile/efileList.do?cid=<%=cid %>&type=<%=type %>&pageInfo='+value;			
		}
		function delInfo(id){
			//alert(valueid);			
			if(confirm('你真得要删除数据吗?\r删除后不能恢复.\r请慎重操作.')){
				window.location.href='<%=basePath %>tjsinfo/tjsoa/efile/efileDel.do?&cid=<%=cid %>&type=<%=type %>&id='+id;
			}
		}
		//-->
</script>
</head>

<body>
<div id="basic" style="margin:0 auto;">
    <!--导航开始处-->
    <div id="index_title">
	    <ul>
		    <li id="ul_title1" class="over"><a onclick="change(0)" style="cursor:hand"><span><%=menuName %></span></a></li>
		</ul>
	</div>
    <!--这里开始是显示、隐藏的内容-->
    <div id="draft_list" class="draft_list">
        <ul>
        	
        	<%
        	int intPageInfo;
			int intPageSizeInfo =12;//一页显示的行数
			int intPageCountInfo;//总页数
			int intRowCountInfo;//总行数
			String strPageInfo;
			intRowCountInfo = list.size();
			intPageCountInfo = (intRowCountInfo + intPageSizeInfo - 1) / intPageSizeInfo;
			strPageInfo = request.getParameter("pageInfo");
			if (strPageInfo == null) {//表明在QueryString中没有page这一个参数，此时显示第一页数据 
				intPageInfo = 1;
			} else {//将字符串转换成整型 
				intPageInfo = Integer.parseInt(strPageInfo);
				if (intPageInfo < 1)intPageInfo = 1;
			}
			if (intPageInfo > intPageCountInfo)intPageInfo = intPageCountInfo;
        	if(intPageCountInfo > 0) {
				//将记录指针定位到待显示页的第一条记录上 
				int i=((intPageInfo - 1) * intPageSizeInfo );
				for(int j=0;j<intPageSizeInfo && i<intRowCountInfo;j++,i++){
        		
				Efile pend = (Efile)list.get(i);
				String title=pend.getCfileName();
				String allPath=pend.getAllPath();
        	%>
        	
			<%if(i%6==0){%></ul>
			<ul><%} %>		
			<li><span><%=pend.getRemark() %></span><a href="<%=basePath%>tjsinfo/tjsoa/efile/efile.do?id=<%=pend.getId() %>"><%=title %></a>
			<%if(lev1.equals("true") || lev2.equals("true") || lev3.equals("true") || lev4.equals("true") || lev5.equals("true")){ %>
			<a href="javascript:delInfo('<%=pend.getId() %>')"><font color="blue">删除</font></a>
			<%}else{} %>
			<%} %></li>
			<%}%>
			
			</ul>
			
			<div style="padding-top: 15px;text-align: center;">
				<%if(intPageInfo>=2) {%><a href="<%=basePath %>tjsinfo/tjsoa/efile/efileList.do?cid=<%=cid %>&type=<%=type %>&pageInfo=<%=intPageInfo - 1%>">上一页</a> <%} %>
				<%if(intPageInfo<intPageCountInfo) {%><a href="<%=basePath %>tjsinfo/tjsoa/efile/efileList.do?cid=<%=cid %>&type=<%=type %>&pageInfo=<%=intPageInfo + 1%>">下一页</a><%} %>&nbsp;&nbsp;&nbsp; 
				页次:<STRONG><%=intPageInfo %></STRONG>/<%=intPageCountInfo %>页 共<%=list.size() %>条记录 <%=intPageSizeInfo %>条/页
				<select name="select8" onChange="submitInfoPages(this.value,'1')">
	        		      <option value="0">--跳转--</option>
	        		      <%
	        		      	for(int pi=1;pi<=intPageCountInfo;pi++){
	        		      %>
	        		      	<option value="<%=pi%>"><%=pi%></option>
	        		      <%} %>
	            </select>
			</div>
			<%{ %>
			<%if(cid.equals("1") && lev1.equals("true")){ %>
		    <a href="<%=basePath %>tjsinfo/tjsoa/efile/upNewAction.do?cid=<%=cid %>&type=<%=type %>" style="color:blue">添加<%=menuName %></a>
		    <%}else if(cid.equals("2") && lev2.equals("true")){%>
		    <a href="<%=basePath %>tjsinfo/tjsoa/efile/upNewAction.do?cid=<%=cid %>&type=<%=type %>" style="color:blue">添加<%=menuName %></a>
		    <%}else if(cid.equals("3") && lev3.equals("true")){%>
		    <a href="<%=basePath %>tjsinfo/tjsoa/efile/upNewAction.do?cid=<%=cid %>&type=<%=type %>" style="color:blue">添加<%=menuName %></a>
		    <%}else if(cid.equals("4") && lev4.equals("true")){%>
		    <a href="<%=basePath %>tjsinfo/tjsoa/efile/upNewAction.do?cid=<%=cid %>&type=<%=type %>" style="color:blue">添加<%=menuName %></a>
		    <%}else if(cid.equals("5") && lev5.equals("true")){%>
		    <a href="<%=basePath %>tjsinfo/tjsoa/efile/upNewAction.do?cid=<%=cid %>&type=<%=type %>" style="color:blue">添加<%=menuName %></a>
		    <%} }%>
    </div>
</div>
</body>
</html>

